<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Mocha Tests for Blockly</title>

    <link href="https://unpkg.com/mocha@5.2.0/mocha.css" rel="stylesheet" />
    <script src="../../blockly_uncompressed.js"></script>
    <script src="../../msg/messages.js"></script>
    <script src="../../blocks/procedures.js"></script>
  </head>
  <body>

    <div id="mocha"></div>
    <div id="failureCount" style="display:none" tests_failed="unset"></div>
    <script src="https://unpkg.com/chai/chai.js"></script>
    <script src="https://unpkg.com/mocha@5.2.0/mocha.js"></script>
    <script src="https://unpkg.com/sinon/pkg/sinon.js"></script>
    <script>
      mocha.setup({
        ui: 'tdd'
      });
    </script>

    <script src="test_helpers.js"></script>

    <script src="astnode_test.js"></script>
    <script src="block_test.js"></script>
    <script src="comment_test.js"></script>
    <script src="connection_db_test.js"></script>
    <script src="connection_test.js"></script>
    <script src="connection_db_test.js"></script>
    <script src="cursor_test.js"></script>
    <script src="dropdowndiv_test.js"></script>
    <script src="event_test.js"></script>
    <script src="field_test.js"></script>
    <script src="field_angle_test.js"></script>
    <script src="field_checkbox_test.js"></script>
    <script src="field_colour_test.js"></script>
    <script src="field_date_test.js"></script>
    <script src="field_dropdown_test.js"></script>
    <script src="field_image_test.js"></script>
    <script src="field_label_test.js"></script>
    <script src="field_label_serializable_test.js"></script>
    <script src="field_number_test.js"></script>
    <script src="field_registry_test.js"></script>
    <script src="field_textinput_test.js"></script>
    <script src="field_variable_test.js"></script>
    <script src="gesture_test.js"></script>
    <script src="input_test.js"></script>
    <script src="key_map_test.js"></script>
    <script src="metrics_test.js"></script>
    <script src="names_test.js"></script>
    <script src="navigation_modify_test.js"></script>
    <script src="navigation_test.js"></script>
    <script src="procedures_test.js"></script>
    <script src="theme_test.js"></script>
    <script src="trashcan_test.js"></script>
    <script src="utils_test.js"></script>
    <script src="xml_procedures_test.js"></script>
    <script src="xml_test.js"></script>

    <div id="blocklyDiv"></div>
    <xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-minimal" style="display: none">
      <block type="basic_block"></block>
    </xml>

    <xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-categories" style="display: none">
      <category name="First">
        <block type="basic_block">
          <field name="TEXT">FirstCategory-FirstBlock</field>
        </block>
        <block type="basic_block">
          <field name="TEXT">FirstCategory-SecondBlock</field>
        </block>
      </category>
      <category name="Second">
        <block type="basic_block">
          <field name="TEXT">SecondCategory-FirstBlock</field>
        </block>
      </category>
    </xml>
    <xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-connections" style="display: none">
      <block type="stack_block"></block>
      <block type="row_block"></block>
    </xml>

    <script>
      mocha.run(function(failures) {
        var failureDiv = document.getElementById('failureCount');
        failureDiv.setAttribute('tests_failed', failures);
      });
    </script>
  </body>
</html>
